/**
 * Created by liutianxue on 2018-02-03.
 */
$.validator.addMethod("port", function(value) {
    return !isNaN(value) && value>=0 && value <= 65535;
}, "请输入正确的端口号");

$.validator.addMethod("widip", function(value) {
    var pattern = /(^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$)|(^[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}.[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}$)/;
    return pattern.test(value);
}, "请输入正确的ip");

